#include <pwd.h>
#include <grp.h>
#include <net/if.h>
#include <sys/ioctl.h>
#include <sys/syslog.h>
#include <stdarg.h>
#include <errno.h>
#include <stdio.h>
#include <fcntl.h>
#include <unistd.h>
#include <string.h>
#include <time.h>
#include <sys/types.h>
#include <sys/stat.h>
#include <dirent.h>
#include <errno.h>
#include <netinet/in.h>
#include <sys/socket.h>
#include <resolv.h>
#include <arpa/inet.h>
#include <stdlib.h>
#include <signal.h>
#include <getopt.h>
#include <net/if.h>
#include <sys/ioctl.h>

#define MAXBUF        1024
#define MAXPATH       (256+16)


char buffer[MAXBUF + 1];
char ip[128];
char port[128];
char back[128];
char home_dir[128];


void wrtinfomsg(char *msg);
int get_arg (char *cmd);
char file_type(mode_t st_mode);
//search the up-path of dirpath
char *dir_up(char *dirpath);
 //send the path data to client ;if path is a file ,send the data, if path is a dir, list
void GiveResponse(FILE * client_sock, char *Path);
void init_daemon(const char *pname, int facility);
int get_addr(char *str);

